home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet multimedia / Animacje, filmy i prezentacje / Odtwarzacze filmow / JahPlayer 0.1.0 / jahplayer-0.1.0-installer.exe / openlibraries-0.3.0-runtime.exe / shaders / yuv444_to_rgb.frag < prev   
Text File  |  2006-09-04  |  695b  |  28 lines

  1.  
  2. // fx - A compositing library representation.
  3.  
  4. // Copyright (C) 2005-2006 Visual Media FX Ltd.
  5. // Released under the LGPL.
  6. // For more information, see http://www.openlibraries.org.
  7.  
  8. uniform sampler2D inColor0;
  9. uniform float alpha;
  10. uniform vec2 offsets;
  11. uniform mat4 channel_selector;
  12.  
  13. varying vec2 v_tex;
  14.  
  15. const vec4 shift = vec4( 0.0625, 0.5, 0.5, 0.0 );
  16.  
  17. void main( void )
  18. {
  19.     mat4 RGB = mat4( vec4( 1.1640,  1.16400, 1.164, 0.0 ),
  20.                      vec4( 0.0000, -0.39173, 2.017, 0.0 ),
  21.                      vec4( 1.5958, -0.81290, 0.000, 0.0 ),
  22.                      vec4( 0.0, 0.0, 0.0, 1.0 ) );
  23.     
  24.     vec4 color = RGB * ( texture2D( inColor0, v_tex ) - shift );
  25.  
  26.     gl_FragColor = channel_selector * color;
  27. }
  28.